package com.example.service;

import com.example.entity.RestrictedDocument;
import com.example.entity.RestrictedDocumentQuery;
import com.example.mapper.RestrictedDocumentMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RestrictedDocumentService {

    @Resource
    private RestrictedDocumentMapper restrictedDocumentMapper;

    public PageInfo<RestrictedDocument> selectPage(RestrictedDocumentQuery restrictedDocumentQuery, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize); // 启动分页
        List<RestrictedDocument> list = restrictedDocumentMapper.selectPageList(restrictedDocumentQuery);
        return PageInfo.of(list);
    }
}
